﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Management;

namespace WINADM.Server.WMI
{
    public class Win32Process
    {
        string _Caption;

        public string Caption
        {
            get { return _Caption; }
            set { _Caption = value; }
        }
        string _CommandLine;

        public string CommandLine
        {
            get { return _CommandLine; }
            set { _CommandLine = value; }
        }
        DateTime? _CreationDate;

        public DateTime? CreationDate
        {
            get { return _CreationDate; }
            set { _CreationDate = value; }
        }
        string _Description;

        public string Description
        {
            get { return _Description; }
            set { _Description = value; }
        }
        string _ExecutablePath;

        public string ExecutablePath
        {
            get { return _ExecutablePath; }
            set { _ExecutablePath = value; }
        }
        UInt64? _KernelModeTime;

        public UInt64? KernelModeTime
        {
            get { return _KernelModeTime; }
            set { _KernelModeTime = value; }
        }
        string _Name;

        public string Name
        {
            get { return _Name; }
            set { _Name = value; }
        }
        UInt32? _PageFileUsage;

        public UInt32? PageFileUsage
        {
            get { return _PageFileUsage; }
            set { _PageFileUsage = value; }
        }
        UInt32? _ParentProcessId;

        public UInt32? ParentProcessId
        {
            get { return _ParentProcessId; }
            set { _ParentProcessId = value; }
        }
        UInt32? _Priority;

        public UInt32? Priority
        {
            get { return _Priority; }
            set { _Priority = value; }
        }
        UInt64? _PrivatePageCount;

        public UInt64? PrivatePageCount
        {
            get { return _PrivatePageCount; }
            set { _PrivatePageCount = value; }
        }
        UInt32? _ProcessId;

        public UInt32? ProcessId
        {
            get { return _ProcessId; }
            set { _ProcessId = value; }
        }
        UInt32? _ThreadCount;

        public UInt32? ThreadCount
        {
            get { return _ThreadCount; }
            set { _ThreadCount = value; }
        }
        UInt64? _UserModeTime;

        public UInt64? UserModeTime
        {
            get { return _UserModeTime; }
            set { _UserModeTime = value; }
        }
        UInt64? _VirtualSize;

        public UInt64? VirtualSize
        {
            get { return _VirtualSize; }
            set { _VirtualSize = value; }
        }

        public Win32Process()
        {
        }
        public Win32Process(ManagementObject wmiWin32ProcessObject)
        {
            this._Caption = (string)wmiWin32ProcessObject["Caption"];
            this._CommandLine = (string)wmiWin32ProcessObject["CommandLine"];
            this._CreationDate = WMIUtility.ConvertDmtfToDateTime(wmiWin32ProcessObject["CreationDate"]);
            this._Description = (string)wmiWin32ProcessObject["Description"];
            this._ExecutablePath = (string)wmiWin32ProcessObject["ExecutablePath"];
            this._KernelModeTime = (UInt64?)wmiWin32ProcessObject["KernelModeTime"];
            this._Name = (string)wmiWin32ProcessObject["Name"];
            this._PageFileUsage = (UInt32?)wmiWin32ProcessObject["PageFileUsage"];
            this._ParentProcessId = (UInt32?)wmiWin32ProcessObject["ParentProcessId"];
            this._Priority = (UInt32?)wmiWin32ProcessObject["Priority"];
            this._PrivatePageCount = (UInt64?)wmiWin32ProcessObject["PrivatePageCount"];
            this._ProcessId = (UInt32?)wmiWin32ProcessObject["ProcessId"];
            this._ThreadCount = (UInt32?)wmiWin32ProcessObject["ThreadCount"];
            this._UserModeTime = (UInt64?)wmiWin32ProcessObject["UserModeTime"];
            this._VirtualSize = (UInt64?)wmiWin32ProcessObject["VirtualSize"];
        }
    }
}
